class ListFiles extends JSCommand {
	
	private static final String cmdName = "ls";
	
	public String runCommand(String[] commandArgs, JShell shell) {
		
		String result;
		JSDirectory workDir = shell.getWorkDir();
		boolean validArgs = isValidArgs(commandArgs, shell);
		
		validArgs = true;
		if (validArgs) {
			result = workDir.getContents();
		} else {
			result = invalidArgsMessage;
		}
		
		return result;
	}
	
	private static boolean isValidArgs(String[] commandArgs, JShell shell) { 
		return (commandArgs[0] == cmdName &&
				commandArgs.length == 1);	
	}
}